package com.example.redstarcommerce.cn.dh.user.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Collection;
import java.util.List;
import java.util.UUID;

/**
 * @ClassName User
 * @Author AndyWu
 * @Date 2024-10-31 22:25
 * @Motto 学不死就往死里学
 * @Version 1.0
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("user")
public class User implements Serializable, UserDetails {

    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    @TableField("uid")
    private String uid;

    @TableField("name")
    private String name;

    @TableField("password")
    private String password;

    @TableField("begintime")
    private Timestamp begintime;

    @TableField("recentlytime")
    private Timestamp recentlytime;

    @TableField("lasttime")
    private Timestamp lasttime;

    public User(String uid, String name, String password, Timestamp begintime, Timestamp recentlytime, Timestamp lasttime) {
        this.uid = uid;
        this.name = name;
        this.password = password;
        this.begintime = begintime;
        this.recentlytime = recentlytime;
        this.lasttime = lasttime;
    }

    public <T> User(String name, String password, List<T> asList) {
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getUsername() {
        return null;
    }

    @Override
    public boolean isAccountNonExpired() {
        return false;
    }

    @Override
    public boolean isAccountNonLocked() {
        return false;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return false;
    }

    @Override
    public boolean isEnabled() {
        return false;
    }
}
